package router

import (
	"net/http"
	"ubt-rbac-service/internal/app/controller/comm_ctl"
	"ubt-rbac-service/internal/app/controller/info_ctl"
	"ubt-rbac-service/internal/app/controller/sys_ctl"
)

func Routes() map[RouteItem]func(w http.ResponseWriter, r *http.Request) {
	var routes = make(map[RouteItem]func(w http.ResponseWriter, r *http.Request))
	// 一些通用的接口
	routes[RouteItem{Method: "GET", Path: "/common/img-code"}] = comm_ctl.CommCtl.ImgCode
	routes[RouteItem{Method: "GET", Path: "/common/areas"}] = comm_ctl.CommCtl.Areas
	// 模块相关接口
	routes[RouteItem{Method: "POST", Path: "/system/module/save"}] = sys_ctl.SysModCtl.Save
	routes[RouteItem{Method: "POST", Path: "/system/module/deletes"}] = sys_ctl.SysModCtl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/module/one"}] = sys_ctl.SysModCtl.One
	routes[RouteItem{Method: "GET", Path: "/system/module/list"}] = sys_ctl.SysModCtl.List
	routes[RouteItem{Method: "GET", Path: "/system/module/select"}] = sys_ctl.SysModCtl.Select
	routes[RouteItem{Method: "GET", Path: "/system/module/tree"}] = sys_ctl.SysModCtl.Tree
	routes[RouteItem{Method: "GET", Path: "/system/module/sort"}] = sys_ctl.SysModCtl.Sort
	routes[RouteItem{Method: "GET", Path: "/system/module/menu"}] = sys_ctl.SysModCtl.Menu
	// 按钮相关接口
	routes[RouteItem{Method: "POST", Path: "/system/button/save"}] = sys_ctl.SysBtnCtl.Save
	routes[RouteItem{Method: "POST", Path: "/system/button/deletes"}] = sys_ctl.SysBtnCtl.Deletes
	routes[RouteItem{Method: "POST", Path: "/system/button/del-by-mod"}] = sys_ctl.SysBtnCtl.DelByMod
	routes[RouteItem{Method: "GET", Path: "/system/button/one"}] = sys_ctl.SysBtnCtl.One
	routes[RouteItem{Method: "GET", Path: "/system/button/page"}] = sys_ctl.SysBtnCtl.Page
	routes[RouteItem{Method: "GET", Path: "/system/button/select"}] = sys_ctl.SysBtnCtl.Select
	routes[RouteItem{Method: "GET", Path: "/system/button/sort"}] = sys_ctl.SysBtnCtl.Sort
	// 角色相关接口
	routes[RouteItem{Method: "POST", Path: "/system/role/save"}] = sys_ctl.SysRoleCtl.Save
	routes[RouteItem{Method: "POST", Path: "/system/role/deletes"}] = sys_ctl.SysRoleCtl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/role/one"}] = sys_ctl.SysRoleCtl.One
	routes[RouteItem{Method: "GET", Path: "/system/role/page"}] = sys_ctl.SysRoleCtl.Page
	routes[RouteItem{Method: "GET", Path: "/system/role/select"}] = sys_ctl.SysRoleCtl.Select
	// 用户相关接口
	routes[RouteItem{Method: "POST", Path: "/system/user/login"}] = sys_ctl.SysUserCtl.Login
	routes[RouteItem{Method: "GET", Path: "/system/user/session"}] = sys_ctl.SysUserCtl.Session
	routes[RouteItem{Method: "POST", Path: "/system/user/exit"}] = sys_ctl.SysUserCtl.Exit
	routes[RouteItem{Method: "POST", Path: "/system/user/save"}] = sys_ctl.SysUserCtl.Save
	routes[RouteItem{Method: "POST", Path: "/system/user/process"}] = sys_ctl.SysUserCtl.Process
	routes[RouteItem{Method: "POST", Path: "/system/user/personal"}] = sys_ctl.SysUserCtl.Personal
	routes[RouteItem{Method: "GET", Path: "/system/user/one"}] = sys_ctl.SysUserCtl.One
	routes[RouteItem{Method: "GET", Path: "/system/user/page"}] = sys_ctl.SysUserCtl.Page
	routes[RouteItem{Method: "GET", Path: "/system/user/select"}] = sys_ctl.SysUserCtl.Select
	// 分类相关接口
	routes[RouteItem{Method: "POST", Path: "/system/type/save"}] = sys_ctl.SysTypeCtl.Save
	routes[RouteItem{Method: "POST", Path: "/system/type/deletes"}] = sys_ctl.SysTypeCtl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/type/one"}] = sys_ctl.SysTypeCtl.One
	routes[RouteItem{Method: "GET", Path: "/system/type/list"}] = sys_ctl.SysTypeCtl.List
	routes[RouteItem{Method: "GET", Path: "/system/type/tree"}] = sys_ctl.SysTypeCtl.Tree
	routes[RouteItem{Method: "GET", Path: "/system/type/sort"}] = sys_ctl.SysTypeCtl.Sort
	// 数据字典相关接口
	routes[RouteItem{Method: "POST", Path: "/system/dict/save"}] = sys_ctl.SysDict.Save
	routes[RouteItem{Method: "POST", Path: "/system/dict/deletes"}] = sys_ctl.SysDict.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/dict/one"}] = sys_ctl.SysDict.One
	routes[RouteItem{Method: "GET", Path: "/system/dict/page"}] = sys_ctl.SysDict.Page
	routes[RouteItem{Method: "GET", Path: "/system/dict/select"}] = sys_ctl.SysDict.Select
	routes[RouteItem{Method: "GET", Path: "/system/dict/sort"}] = sys_ctl.SysDict.Sort
	// 标签相关接口
	routes[RouteItem{Method: "POST", Path: "/system/tag/save"}] = sys_ctl.SysTagCtl.Save
	routes[RouteItem{Method: "POST", Path: "/system/tag/deletes"}] = sys_ctl.SysTagCtl.Deletes
	routes[RouteItem{Method: "GET", Path: "/system/tag/page"}] = sys_ctl.SysTagCtl.Page
	routes[RouteItem{Method: "POST", Path: "/system/tag/add"}] = sys_ctl.SysTagCtl.Add
	routes[RouteItem{Method: "POST", Path: "/system/tag/delete"}] = sys_ctl.SysTagCtl.Delete
	// 文件相关接口
	routes[RouteItem{Method: "POST", Path: "/system/file/upload-oss"}] = sys_ctl.SysFileCtl.UploadOss
	routes[RouteItem{Method: "POST", Path: "/system/file/download-oss"}] = sys_ctl.SysFileCtl.DownloadOss
	routes[RouteItem{Method: "POST", Path: "/system/file/upload"}] = sys_ctl.SysFileCtl.Upload
	routes[RouteItem{Method: "POST", Path: "/system/file/image"}] = sys_ctl.SysFileCtl.UpImg4We
	routes[RouteItem{Method: "POST", Path: "/system/file/video"}] = sys_ctl.SysFileCtl.Upvd4We
	routes[RouteItem{Method: "POST", Path: "/system/file/download"}] = sys_ctl.SysFileCtl.Download
	routes[RouteItem{Method: "POST", Path: "/system/file/upd-name"}] = sys_ctl.SysFileCtl.UpdName
	routes[RouteItem{Method: "POST", Path: "/system/file/upd-type"}] = sys_ctl.SysFileCtl.UpdType
	routes[RouteItem{Method: "POST", Path: "/system/file/deletes"}] = sys_ctl.SysFileCtl.Deletes
	routes[RouteItem{Method: "POST", Path: "/system/file/delete"}] = sys_ctl.SysFileCtl.Delete
	routes[RouteItem{Method: "GET", Path: "/system/file/one"}] = sys_ctl.SysFileCtl.One
	routes[RouteItem{Method: "GET", Path: "/system/file/page"}] = sys_ctl.SysFileCtl.Page
	// 消息相关接口
	routes[RouteItem{Method: "POST", Path: "/system/notice/process"}] = sys_ctl.SysNoteCtl.Process
	routes[RouteItem{Method: "GET", Path: "/system/notice/one"}] = sys_ctl.SysNoteCtl.One
	routes[RouteItem{Method: "GET", Path: "/system/notice/page"}] = sys_ctl.SysNoteCtl.Page
	routes[RouteItem{Method: "GET", Path: "/system/notice/new"}] = sys_ctl.SysNoteCtl.New
	routes[RouteItem{Method: "POST", Path: "/system/notice/read"}] = sys_ctl.SysNoteCtl.Read
	// 日志相关接口
	routes[RouteItem{Method: "GET", Path: "/system/log/page"}] = sys_ctl.SysLogCtl.Page
	// 资讯相关接口
	routes[RouteItem{Method: "POST", Path: "/information/save"}] = info_ctl.InfoCtl.Save
	routes[RouteItem{Method: "POST", Path: "/information/process"}] = info_ctl.InfoCtl.Process
	routes[RouteItem{Method: "GET", Path: "/information/one"}] = info_ctl.InfoCtl.One
	routes[RouteItem{Method: "GET", Path: "/information/page"}] = info_ctl.InfoCtl.Page
	routes[RouteItem{Method: "GET", Path: "/information/sort"}] = info_ctl.InfoCtl.Sort

	return routes
}
